import request from '../request'

// 添加购物车
export const saveCart = (data) => {
  return request({
    url: '/cart',
    method: 'POST',
    data
  })
}

// 查询购物车列表
export const queryCats = (uid) => {
  return request({
    url: `/cart/${uid}`
  })
}

// 修改购物车数量
export const editCart = (id, num) => {
  return request({
    url: `/cart/${id}/${num}`,
    method: 'PUT'
  })
}

// 删除购物车记录
export const deleteCart = (data) => {
  return request({
    url: `/cart`,
    method: 'DELETE',
    data
  })
}
